Functions for Cluster Management

cluster management

The p4 system supports the cluster model of parallel computation, in which subsets of processes share memory with one another, with the clusters communicating via messages. A procgroup file for a program written for the cluster model might look like this:


\begin{example}
local 4
alliant1.abc.edu 5 /home/me/myprog
alliant2.abc.edu 5 /home/me/myprog
encore.somewhere.edu 5 /usrs/me/myprog
\end{example}

This would specify a total of 20 processes, 5 (including the master) running on the local machine (here assumed to be capable of supporting five processes that share memory) together with 5 slaves each on three other shared-memory machines.

p4_get_cluster_ids
\begin{example}
VOID p4_get_cluster_ids(start,end)
int *start;
int *end;
\end{example}
receives pointers to two integers. It places the p4-assigned id's of the first and last ids within the current cluster into the two arguments (including the remote master).

p4_get_my_cluster_id
\begin{example}
int p4_get_my_cluster_id()
\end{example}
returns a unique id (relative to 0) within a cluster of p4-managed processes. Thus, a cluster master will always have a cluster id of 0. It is not clear that a separate cluster id is really useful, but the functionality is provided just in case.

p4_am_i_cluster_master
\begin{example}
BOOL p4_am_i_cluster_master()
\end{example}
returns a BOOL value indicating whether the invoking process is the ``cluster master'' process within its cluster.

p4_num_cluster_ids
\begin{example}
int p4_num_cluster_ids()
\end{example}
returns an integer value indicating the number of ids in the current cluster as started by p4_create_procgroup.

Functions for Message Passing,Functions for Shared Memory,p4 Functions for Managing Processes and Clusters,Top